-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix checking ammID field of account #5188
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5188 +/- ##
=========================================
- Coverage 77.9% 77.9% -0.0%
=========================================
Files 782 782
Lines 66616 66616
Branches 8161 8158 -3
=========================================
- Hits 51902 51870 -32
- Misses 14714 14746 +32
|
064bd15
to
dddf2b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
Unrelated to this change, but on line 162, an non existent AMM object is returned with rpcACT_NOT_FOUND error. Doesn't sound right, should we fix it?
|
using namespace jtx; | ||
testcase("Invalid amm field"); | ||
|
||
testAMM([&](AMM& amm, Env&) { | ||
auto const resp = amm.ammRpcInfo( | ||
std::nullopt, | ||
jss::validated.c_str(), | ||
std::nullopt, | ||
std::nullopt, | ||
gw); | ||
BEAST_EXPECT( | ||
resp.isMember("error") && resp["error"] == "actNotFound"); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the test could be moved into testErrors()
IMO
It's half correct since AMM might be fetched by amm account. But correct, |
although i believe we may need a new API version for this change |
High Level Overview of Change
This fix add check for sfAMMID field in amm_info handler.
Context of Change
Without this check debug version of rippled crash on assert in ledger::read()
Bug was found during automation testing.
Type of Change
API Impact